package org.wutopia.labcloud.domain.uaa.controller;


import lombok.AllArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.wutopia.labcloud.domain.uaa.controller.vo.output.UserGetUserListOutputVO;
import org.wutopia.labcloud.domain.uaa.controller.vo.output.UserGetUserOutputVO;
import org.wutopia.labcloud.domain.uaa.service.UserService;
import org.wutopia.labcloud.library.common.base.CodedMessage;
import org.wutopia.labcloud.library.common.base.CommonResponse;
import org.wutopia.labcloud.library.common.base.PageInputVO;
import org.wutopia.labcloud.library.common.base.PageOutputVO;

@RestController
@AllArgsConstructor
@RequestMapping("/user")
public class UserController {

    private UserService userService;

    @GetMapping("/{id}")
    public ResponseEntity<CodedMessage<UserGetUserOutputVO>> getUser(@PathVariable Long id) {

        if(id == null) {
            return CommonResponse.failure("入参错误");
        }

        UserGetUserOutputVO userById = userService.getUserById(id);

        return CommonResponse.successWithData(userById);
    }

    @PostMapping("/list")
    public ResponseEntity<CodedMessage<PageOutputVO<UserGetUserListOutputVO>>> getUserList(@RequestBody PageInputVO vo) {



        return null;
    }

    @PostMapping("/bind_authorities")
    public ResponseEntity<CodedMessage<String>> bindAuthorities() {



        return CommonResponse.failure("");
    }


    @PostMapping("/bind_roles")
    public ResponseEntity<CodedMessage<String>> bindRoles() {



        return CommonResponse.failure("");
    }
}
